package com.adtech.adms.commons.tree;

import java.io.Serializable;
import java.util.List;

import com.adtech.adms.system.pojo.Topo;


public class TopoTreeNode implements TreeNode<Topo>{
	private static final long serialVersionUID = -123284237172L;
	private Topo topo;
	private Boolean isParent;
	private List<TreeNode<Topo>> nodes;
	private Long parentId;
	private String nodeIold;
	

	@Override
	public Serializable getId() {
		return topo.getId();
	}

	public Long getParentId() {
		if(topo!=null && topo.getParent()!=null){
			
			parentId = topo.getParent().getId();
			return parentId;
		}
		return null;
	}
	
	public String getNodeIold() {
		if(topo!=null ){
			nodeIold = topo.getNodeid();
			return nodeIold;
		}
		return null;
	}


	public TopoTreeNode(Topo topo) {
		this.topo = topo;
	}
	
	@Override
	public Boolean getChecked() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public Boolean getHalfChecked() {
		// TODO Auto-generated method stub
		return null;
	}



	@Override
	public Topo getInnerObject() {
		// TODO Auto-generated method stub
		return null;
	}

	public void setIsParent(Boolean isParent) {
		this.isParent = isParent;
	}
	@Override
	public Boolean getIsParent() {
		// TODO Auto-generated method stub
		if(nodes!=null && nodes.size()>0) {
			return true;
		}else{
			return false;
		}
//		return isParent;
	}

	@Override
	public String getName() {
		
		return topo.getName();
	}

	@Override
	public List<TreeNode<Topo>> getNodes() {
		// TODO Auto-generated method stub
		return nodes;
	}

	@Override
	public void setNodes(List<TreeNode<Topo>> nodes) {
		this.nodes = nodes;
	}
	
	@Override
	public Boolean getOpen() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public TreeNode<Topo> getParent() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getTarget() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getUrl() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean isLeaf() {
		// TODO Auto-generated method stub
		return false;
	}



}
